package com.andy.microservice.application1.controller;

import com.andy.microservice.application1.feign.FeignService;
import com.andy.microservice.application1.service.Application1Service;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/application1")
@EnableFeignClients
public class Application1Controller {

    //    @org.apache.dubbo.config.annotation.Reference
    //注入service （基于dubbo协议）
    @Autowired
    FeignService feignService;

    @Autowired
    private Application1Service application1Service;

    @GetMapping("/service")
    public String service() {
        String content = application1Service.getContent();
        String s = feignService.suiYi2();
        return content + s ;
    }


}
